from agent.realsubject import RealSubject
from agent.subject import Subject


class Proxy(Subject):

    def __init__(self):
        super().__init__()
        self.realSubject = RealSubject()

    def request(self):
        self.preRequest()
        self.realSubject.request()
        self.postRequest()

    def preRequest(self):
        print("调用方法之前")

    def postRequest(self):
        print("调用方法之后")
